package router

import (
	"github.com/gin-contrib/cors"
	"github.com/gin-gonic/gin"
	"post-master/handel"
)

func Init() *gin.Engine {

	r := gin.Default()

	r.Use(cors.Default())

	r.Static("static", "./static")

	r.POST("/add", handel.Add)

	r.GET("/list", handel.List)

	r.GET("/userRole", handel.UserRole)

	r.GET("/roleNode", handel.RoleNode)

	//r.POST("/coonAdd", handel.CoonAdd)
	//
	//r.POST("/coongoodAdd", handel.CoonGoodAdd)

	r.POST("/userRoleAdd", handel.UserRoleAdd)

	r.POST("/roleNodeAdd", handel.RoleNodeAdd)

	r.GET("/coonGoodsLists", handel.CoonGoodsLists)

	r.GET("/carOrderList", handel.CarOrderList)

	r.POST("/adds", handel.Adds)

	return r

}
